Skip to main content

ValidatorDescriptor<T>

Used for providing metadata about a validator.

Assembly: ServiceStack.dll
View Source
Declaration
public class ValidatorDescriptor<T> : IValidatorDescriptor

Properties

Rules

Rules associated with the validator

View Source
Declaration
protected IEnumerable<IValidationRule> Rules { get; }

Methods

GetName(String)

Gets the display name or a property property

View Source
Declaration
public virtual string GetName(string property)
Returns

System.String

Parameters
TypeName
System.Stringproperty

GetMembersWithValidators()

Gets all members with their associated validators

View Source
Declaration
public virtual ILookup<string, IPropertyValidator> GetMembersWithValidators()
Returns

System.Linq.ILookup<System.String,ServiceStack.FluentValidation.Validators.IPropertyValidator>

GetValidatorsForMember(String)

Gets validators for a specific member

View Source
Declaration
public IEnumerable<IPropertyValidator> GetValidatorsForMember(string name)
Returns

System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.Validators.IPropertyValidator>

Parameters
TypeName
System.Stringname

GetRulesForMember(String)

Gets rules for a specific member

View Source
Declaration
public IEnumerable<IValidationRule> GetRulesForMember(string name)
Returns

System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.IValidationRule>

Parameters
TypeName
System.Stringname

GetName(Expression<Func<T, Object>>)

Gets the member name from an expression

View Source
Declaration
public virtual string GetName(Expression<Func<T, object>> propertyExpression)
Returns

System.String

Parameters
TypeName
System.Linq.Expressions.Expression<System.Func<<T>,System.Object>>propertyExpression

GetValidatorsForMember<TValue>(MemberAccessor<T, TValue>)

Gets validators for a member

View Source
Declaration
public IEnumerable<IPropertyValidator> GetValidatorsForMember<TValue>(MemberAccessor<T, TValue> accessor)
Returns

System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.Validators.IPropertyValidator>

Parameters
TypeName
ServiceStack.FluentValidation.Internal.MemberAccessor<<T>,<TValue>>accessor
Type Parameters
  • TValue

GetRulesByRuleset()

Gets rules grouped by ruleset

View Source
Declaration
public IEnumerable<ValidatorDescriptor<T>.RulesetMetadata> GetRulesByRuleset()
Returns

System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.ValidatorDescriptor`1.RulesetMetadata>

Implements